/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ania2.gui;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author pawel
 */
public class RowHeaderCellRenderer extends JLabel implements TableCellRenderer {

    public RowHeaderCellRenderer() {
        super();
        setOpaque(true);
    }

    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {
        setBackground(new Color(238, 238, 238));
        this.setHorizontalAlignment(CENTER);
        setText((value == null) ? "" : value.toString());

        return this;
    }
}
